package HLLibClasses;

import HLCode.HLClassManager;
import HLCode.HLLibClass;
import HLCode.HLObject;
import HLLib.http.HLFuckHttpClient;
import HLLib.http.HLFuckHttpContext;

public class HLClassFuckHttpClient extends HLLibClass {
    public HLClassFuckHttpClient(HLClassManager owner) {
        super(owner);
    }

    public HLObject NewObject() {
        return new HLFuckHttpClient();
    }

    public void Execute(HLObject self, int index, HLObject args, HLObject resultOwnerObject, int resultIndex) {
        switch (index) {
        case 0: {
            ((HLFuckHttpClient) self).Stop();
            break;
        }
        case 1: {
            ((HLFuckHttpClient) self).SendRequest((HLFuckHttpContext)args.GetObject(0));
            break;
        }
        case 2: {
            if (resultOwnerObject == null) {
                ((HLFuckHttpClient) self).GetCount();
            } else {
                resultOwnerObject.SetInt(resultIndex, ((HLFuckHttpClient) self).GetCount());
            }
            break;
        }
        case 3: {
            ((HLFuckHttpClient) self).run();
            break;
        }
        }
    }
}
